package org.congapps.employees.model;

import java.util.Date;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Temporal;
import static javax.persistence.TemporalType.DATE;

@Entity
@Table(name="salaries")
public class Salary implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	private SalaryId id;
	private int salary;
	private Date toDate;

	public Salary() {
	}

	public Salary(SalaryId id, int salary, Date toDate) {
		this.id = id;
		this.salary = salary;
		this.toDate = toDate;
	}

	@Column(name="salary")
	public int getSalary() {
		return this.salary;
	}

	public void setSalary(int salary) {
		this.salary = salary;
	}

	@EmbeddedId
	public SalaryId getId() {
		return id;
	}

	public void setId(SalaryId id) {
		this.id = id;
	}

	@Column(name="to_date")
	@Temporal(DATE)
	public Date getToDate() {
		return this.toDate;
	}

	public void setToDate(Date toDate) {
		this.toDate = toDate;
	}
}
